import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';

import 'colors.dart';
import 'dimens.dart';
import 'font_family.dart';

class TextStyles {
  ///appBar 字体样式
  static TextStyle titleTextStyle = TextStyle(
      fontSize: ScreenUtil().setSp(34),
      fontFamily: Font.PingFangMedium,
      color: Colours.appC1);

  static TextStyle titleBarStyle = TextStyle(
      fontSize: ScreenUtil().setSp(34),
      fontFamily: Font.PingFangMedium,
      color: Colours.appC1);

  static TextStyle nameTextStyle = TextStyle(
      fontSize: ScreenUtil().setSp(32),
      fontFamily: Font.PingFangBlod,
      color: Colours.tvBlack);

  static TextStyle textFiled =  TextStyles.custom(30, Colours.appC2, Font.PingFangRegular);

  static TextStyle kanBanNum = TextStyle(
      fontSize: ScreenUtil().setSp(Dimens.p1),
      color: Colours.appC1,
      fontFamily: Font.PingFangMedium);

  static TextStyle columnName =
      TextStyles.custom(Dimens.p5, Colours.appC1, Font.PingFangMedium);

  static TextStyle columnValue =
      TextStyles.custom(Dimens.p6, Colours.appC2, Font.PingFangMedium);

  ///传入样式
  static TextStyle custom(double size, Color color, String fontFamily) {
    return TextStyle(
        fontSize: ScreenUtil().setSp(size),
        color: color,
        fontFamily: fontFamily);
  }

  ///表单左侧的文本
  static TextStyle fromLeft = TextStyle(
      color: Colours.tv4c,
      fontSize: ScreenUtil().setSp(34.0),
      fontFamily: Font.PingFangMedium);

  ///变淡右侧的文本
  static TextStyle fromRight = TextStyle(
      color: Colours.tv4c,
      fontSize: ScreenUtil().setSp(32.0),
      fontFamily: Font.PingFangMedium);

  ///表单左侧的文本1
  static TextStyle fromLeft1 = TextStyle(
      color: Colours.tv4c,
      fontSize: ScreenUtil().setSp(30.0),
      fontFamily: Font.PingFangMedium);

  static TextStyle fromRight1 = TextStyles.custom(
      Dimens.p4, Colours.appC6, Font.PingFangRegular);

  ///表单提示
  static TextStyle fromTips = TextStyle(
      color: Colours.tv9c,
      fontSize: ScreenUtil().setSp(28.0),
      fontFamily: Font.PingFangMedium);

  static TextStyle kanBanNumMsg = TextStyle(
      fontSize: ScreenUtil().setSp(Dimens.p6),
      color: Colours.appC2,
      fontFamily: Font.PingFangRegular);

  ///功能菜单的字体样式
  static TextStyle funMenuMsg = TextStyle(
      fontSize: ScreenUtil().setSp(Dimens.p6),
      color: Colours.appC2,
      fontFamily: Font.PingFangRegular);

  ///可借余额等 ...样式
  static TextStyle mineTs1 = TextStyle(
      fontFamily: Font.PingFangMedium,
      fontSize: ScreenUtil().setSp(24),
      color: Colours.tv9c);

  ///可借余额等 数值 ...样式
  static TextStyle mineTs2 = TextStyle(
      fontFamily: Font.PingFangMedium,
      fontSize: ScreenUtil().setSp(32),
      color: Colours.tvBlack);

  ///申请中的借款等 数值 ...样式
  static TextStyle mineTs3 = TextStyle(
      fontFamily: Font.PingFangMedium,
      fontSize: ScreenUtil().setSp(32),
      color: Colours.baseTextColor);

  ///借款管理相关 ...样式
  static TextStyle mineTs4 = TextStyle(
      fontFamily: Font.PingFangMedium,
      fontSize: ScreenUtil().setSp(24),
      color: Colours.tv4c);

  ///借款管理相关 ...样式
  static TextStyle mineTs5 = TextStyle(
      fontFamily: Font.PingFangMedium,
      fontSize: ScreenUtil().setSp(32),
      color: Colours.tv4c);

  /// ...样式
  static TextStyle mineTs6 = TextStyle(
      fontFamily: Font.PingFangMedium,
      fontSize: ScreenUtil().setSp(24),
      color: Colours.cc9cad3);
}

class Decorations {
  static Decoration bottom = BoxDecoration(
      border:
          Border(bottom: BorderSide(width: 0.33, color: Colours.baseBtnColor)));

  static Decoration d1 = BoxDecoration(
    border: new Border.all(color: Colours.tv4c, width: 0.5), // 边色与边宽度
    //color: Color(0xFF9E9E9E), // 底色
    borderRadius: new BorderRadius.circular((5.0)), // 圆角度
    //  borderRadius: new BorderRadius.vertical(top: Radius.elliptical(20, 50)), // 也可控件一边圆角大小
  );

  static Decoration dshadow = new BoxDecoration(
      borderRadius: new BorderRadius.circular((5.0)), // 圆角度
      color: Colours.white,
      shape: BoxShape.rectangle,
      boxShadow: [
        BoxShadow(
          color: Colors.grey[300],
          offset: Offset(1, 1),
          blurRadius: 5,
        ),

      ]);

  static Decoration d2 = BoxDecoration(
    border: new Border.all(color: Colours.appC5, width: 1), // 边色与边宽度
    //color: Color(0xFF9E9E9E), // 底色
    borderRadius: new BorderRadius.circular((4.0)), // 圆角度
    //  borderRadius: new BorderRadius.vertical(top: Radius.elliptical(20, 50)), // 也可控件一边圆角大小
  );

  static Decoration d3 = BoxDecoration(
    border: new Border.all(color: Colors.lightBlue, width: 1), // 边色与边宽度
    color: Colors.lightBlue, // 底色
    borderRadius: new BorderRadius.circular((8.0)), // 圆角度
    //  borderRadius: new BorderRadius.vertical(top: Radius.elliptical(20, 50)), // 也可控件一边圆角大小
  );

  ///左侧选中的
  static Decoration d4 = BoxDecoration(
    border: new Border.all(color: Colors.lightBlue, width: 1), // 边色与边宽度
    color: Colors.lightBlue, // 底色
    //borderRadius: new BorderRadius.circular((4.0)), // 圆角度
    borderRadius:
        new BorderRadius.horizontal(left: Radius.circular(4.0)), // 也可控件一边圆角大小
    //vertical(top: Radius.elliptical(20, 50))
  );

  ///左侧未选中的
  static Decoration d5 = BoxDecoration(
    border: new Border.all(color: Colors.lightBlue, width: 1), // 边色与边宽度
    //  color: Colors.lightBlue, // 底色
    borderRadius: new BorderRadius.horizontal(left: Radius.circular(4.0)),
  );

  ///右侧侧选中的
  static Decoration d6 = BoxDecoration(
    border: new Border.all(color: Colors.lightBlue, width: 1), // 边色与边宽度
    color: Colors.lightBlue, // 底色
    //borderRadius: new BorderRadius.circular((4.0)), // 圆角度
    borderRadius:
        new BorderRadius.horizontal(right: Radius.circular(4.0)), // 也可控件一边圆角大小
    //vertical(top: Radius.elliptical(20, 50))
  );

  ///左侧未选中的
  static Decoration d7 = BoxDecoration(
    border: new Border.all(color: Colors.lightBlue, width: 1), // 边色与边宽度
    //  color: Colors.lightBlue, // 底色
    borderRadius: new BorderRadius.horizontal(right: Radius.circular(4.0)),
  );

  ///中间选中的
  static Decoration d8 = BoxDecoration(
    border: new Border.all(color: Colors.lightBlue, width: 1), // 边色与边宽度
    color: Colors.lightBlue, // 底色
    //borderRadius: new BorderRadius.horizontal(right: Radius.circular(4.0)),
  );

  ///中间选中的
  static Decoration d9 = BoxDecoration(
    border: new Border.all(color: Colors.lightBlue, width: 1), // 边色与边宽度
    // color: Colors.lightBlue, // 底色
    //borderRadius: new BorderRadius.horizontal(right: Radius.circular(4.0)),
  );

  static Decoration d10 = BoxDecoration(
    border: new Border.all(color: Colours.tv9c, width: 1), // 边色与边宽度
    //color: Color(0xFF9E9E9E), // 底色
    borderRadius: new BorderRadius.circular((4.0)), // 圆角度
    //  borderRadius: new BorderRadius.vertical(top: Radius.elliptical(20, 50)), // 也可控件一边圆角大小
  );

  ///取消
  static Decoration d11 = BoxDecoration(
    border: new Border.all(color: Colours.cc9cad3, width: 1), // 边色与边宽度
    color: Colours.cc9cad3, // 底色
    borderRadius: new BorderRadius.circular((4.0)), // 圆角度
    //  borderRadius: new BorderRadius.vertical(top: Radius.elliptical(20, 50)), // 也可控件一边圆角大小
  );

  ///确定
  static Decoration d12 = BoxDecoration(
    border: new Border.all(color: Colours.appMainColor, width: 1), // 边色与边宽度
    color: Colours.appMainColor, // 底色
    borderRadius: new BorderRadius.circular((4.0)), // 圆角度
    //  borderRadius: new BorderRadius.vertical(top: Radius.elliptical(20, 50)), // 也可控件一边圆角大小
  );

  static Decoration d13 = BoxDecoration(
    border: new Border.all(color: Colours.appC6, width: 0.5), // 边色与边宽度
    //color: Color(0xFF9E9E9E), // 底色
    borderRadius: new BorderRadius.circular((50.0)), // 圆角度
    //  borderRadius: new BorderRadius.vertical(top: Radius.elliptical(20, 50)), // 也可控件一边圆角大小
  );
}


///卡片样式
class AppCardStyle {
  static const BoxDecoration decoration = BoxDecoration(boxShadow: [
    BoxShadow(
        color: Color(0x99fff5f5),
        offset: Offset(0.0, 0.0),
        blurRadius: 3.0,
        spreadRadius: 2.0),
    BoxShadow(color: Color(0x99fff5f5), offset: Offset(1.0, 1.0)),
    BoxShadow(color: Color(0xFFFFFFFF))
  ]);
}
